package com.bestcem.xm.award.grpc.service.param.draw;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 保存中奖信息请求参数
 *
 * @author hang.li <hang.li@idiaoyan.com>
 * @version v1.0
 * @date 2021/7/8 14:11
 */
@Data
public class SaveWinnerMessageParam {

    /**
     * 页面标识
     */
    @NotBlank(message = "页面标识不能为空")
    @Pattern(regexp = "\\d+", message = "页面标识格式错误")
    @JSONField(name = "award_page")
    private String awardPage;

    /**
     * 抽奖手机号
     */
    @NotBlank(message = "抽奖手机号不能为空")
    @Pattern(regexp = "(1[3-9][0-9])[0-9]{8}", message = "抽奖手机号格式错误")
    @JSONField(name = "phone")
    private String phone;

    /**
     * 中奖人信息
     */
    @Valid
    @NotNull(message = "中奖人信息不能为空")
    @JSONField(name = "winner")
    private WinnerParam winnerParam;
}
